package com.tongtong.stscommon.utils.checker;

import com.tongtong.stscommon.enumration.Message;
import com.tongtong.stscommon.enumration.Status;
import com.tongtong.stscommon.exception.STSResourcesOperationException;

import java.util.Objects;
import java.util.regex.Pattern;

/**
 * 对象检查器
 */
public class ObjectChecker {

	/** 数据库查找对象检查 */
	public static void ObjectsFromDBNullCheck(Object object) {
		if(Objects.isNull(object)) {
			throw new STSResourcesOperationException(Status.ObjectCanNotFound,Message.ObjectCanNotFound);
		}
	}

	/** 前端传入对象检查 */
	public static void ObjectsFromHTTPNullCheck(Object object) {
		if(Objects.isNull(object)) {
			throw new STSResourcesOperationException(Status.ObjectIsNull,Message.ObjectIsNull);
		}
	}
}
